public class TestDemo {
    public static void main(String[] args) {
        System.out.println("*****头插*****");
        MyLinkedList myLinkedList=new MyLinkedList();
        myLinkedList.addFirst(23);
        myLinkedList.addFirst(12);
        myLinkedList.addFirst(1);
        myLinkedList.addFirst(888);
        myLinkedList.addFirst(67);
        myLinkedList.display();//67 888 1 12 23
        myLinkedList.clear();
        myLinkedList.display();//什么都没有

        System.out.println("*****尾插*****");
        myLinkedList.addLast(23);
        myLinkedList.addLast(12);
        myLinkedList.addLast(1);
        myLinkedList.addLast(888);
        myLinkedList.addLast(67);
        myLinkedList.display();//23 12 1 888 67
        myLinkedList.clear();
        myLinkedList.display();//什么都没有

        System.out.println("*****任意位置插入*****");
        myLinkedList.addIndex(0,2);
        myLinkedList.addIndex(1,3);
        myLinkedList.addIndex(1,6);
        myLinkedList.addIndex(2,8);
        myLinkedList.addIndex(3,76);
        myLinkedList.display();//2 6 8 76 3


        System.out.println("*****删除*****");
        myLinkedList.remove(3);
        myLinkedList.remove(6);
        myLinkedList.remove(2);
        myLinkedList.remove(2);
        myLinkedList.display();//8 76

    }
}
